home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0295.lzh / AMOSLIST / text0237.txt < prev    next >
Encoding:
Text File  |  1995-03-01  |  1.2 KB  |  54 lines

  1. In article <D3t1Fn.D55@presby.edu>, astephan@presby.edu (Andrew Stephan) writes:
  2. > I'm having some trouble with AMOS and the manual doesn't seem to explain 
  3. > this.  Basically, I'm trying to write program code like this:
  4.    < cut - cut - cut >
  5.  
  6. I'm not totaly sure bu if I'm not mistaken there is two types of if statments.
  7.  
  8. There is the 
  9.  
  10.   IF <condition> THEN <statment> [ ELSE <statement> ]
  11.  
  12. and the
  13.  
  14.   IF <condition>
  15.     <statements>
  16. [ ELSE
  17.     <statements> ]
  18.   ENDIF
  19.  
  20. and you are not allowed to put a IF - THEN inside a IF - ENDIF
  21.  
  22. The folowing part is not correct:
  23.  
  24.   IF a=2
  25.      IF b=4 THEN print "A" ELSE print "B"
  26.   ELSE
  27.      print "C"
  28.   ENDIF
  29.  
  30. replace it with:
  31.  
  32.   IF a=2
  33.      IF b=4
  34.         print "A"
  35.      ELSE
  36.         print "B"
  37.      ENDIF
  38.   ELSE
  39.      print "C"
  40.   ENDIF
  41.  
  42. /Daniel 
  43.  
  44. *----------------------------------------------+------------------------------*
  45. | Daniel Jönsson                               | "To iterate is human,        |
  46. | Student of Computer Science and Technology   |  to recurse is divine"       |
  47. |                                              |          - Unknown           |
  48. | E-Mail: d94djo@efd.lth.se                    |                              |
  49. *----------------------------------------------+------------------------------*
  50.  
  51.  
  52.  
  53.